import request from '@/utils/request'

// 查询原料功能大类列表
export function listCategory(query) {
  return request({
    url: '/safety/category/list',
    method: 'get',
    params: query
  })
}

// 查询原料功能大类详细
export function getCategory(id) {
  return request({
    url: '/safety/category/' + id,
    method: 'get'
  })
}

// 新增原料功能大类
export function addCategory(data) {
  return request({
    url: '/safety/category',
    method: 'post',
    data: data
  })
}

// 修改原料功能大类
export function updateCategory(data) {
  return request({
    url: '/safety/category',
    method: 'put',
    data: data
  })
}

// 删除原料功能大类
export function delCategory(id) {
  return request({
    url: '/safety/category/' + id,
    method: 'delete'
  })
}

// 新增或修改Item的关联关系
export function batchLink(data) {
    return request({
      url: '/safety/function/batchBind',
      method: 'post',
      data: data
    })
  }